#include "RabbitMqCon.h"

static string uri = "amqp://guest:guest@localhost:5672/%2f";
static string _queue =  "direct.queue1";

RabbitMqCon::RabbitMqCon()
:_ossManage()
,_channel(AmqpClient::Channel::CreateFromUri(uri))
{
    _channel->BasicConsume(_queue);
}


void RabbitMqCon::getMessage(){

    AmqpClient::Envelope::ptr_t envelope = _channel->BasicConsumeMessage();

    if (envelope && envelope->Message()) {
        std::cout<<envelope->Message()->Body()<<"\n";
        _ossManage.OSSupload(envelope->Message()->Body());
    }

}
